package unreleased.geppetto.cat.programs;


import geppetto.cat.corpus.BilingualCorpus;

import java.io.IOException;



public class TestEvolutionWithIterationsMHMMAgree {
	private String corpusDescription;

	private int size, maxSentenceSize, nrIterations;

	boolean withModel1;

	BilingualCorpus corpusF, corpusB;

	public void initCorpus(String args[]) throws IOException {
		corpusDescription = args[0];
		size = Integer.parseInt(args[1]);
		maxSentenceSize = Integer.parseInt(args[2]);
		nrIterations = Integer.parseInt(args[3]);
		withModel1 = Boolean.parseBoolean(args[4]);
		System.out.println("Corpus " + corpusDescription);
		System.out.println("Corpus Size " + size);
		System.out.println("Max sentence size " + maxSentenceSize);
		System.out.println("---");
		System.out.println("Loading Corpus");
		corpusF = BilingualCorpus.getCorpusFromFileDescription(
				corpusDescription, size, maxSentenceSize);
		corpusB = corpusF.reverse();

	}

//	public Evaluation[] runModel(int nrIterations, double smooth) {
//		AgreementHMM mhmm;
//		if (withModel1) {
//			AgreementM1 m1 = new AgreementM1(corpusF, corpusB, 0, 5);
//			m1.train(5);
//			mhmm = new AgreementHMM(corpusF, corpusB, m1.forward._tb,
//					m1.backward._tb, 0, 5);
//		} else {
//			mhmm = new AgreementHMM(corpusF, corpusB, 0, 5);
//		}
//		Evaluation[] evals = new Evaluation[nrIterations];
//		evals = mhmm.trainWithResults(nrIterations, BilingualCorpus.DEV_CORPUS);
//		return evals;
//	}
//
//	public static void main(String[] args) throws IOException {
//		TestEvolutionWithIterationsMHMMAgree test = new TestEvolutionWithIterationsMHMMAgree();
//		test.initCorpus(args);
//		Evaluation[] evals = test.runModel(test.nrIterations, 0);
//		for (int i = 0; i < test.nrIterations; i++) {
//			System.out.println((i + 1) + " " + evals[i].toSimpleString());
//		}
//	}
}
